package com.lv.service.webview

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.tencent.qcloud.tim.tuiofflinepush.utils.BrandUtil


/**
 * 作者： ygx
 * 创建日期：2023/5/9 11:09 AM
 * 签名： 天行健，君子以自强不息；地势坤，君子以厚德载物。
 * -    _              _           _     _   ____  _             _ _
 * -   / \   _ __   __| |_ __ ___ (_) __| | / ___|| |_ _   _  __| (_) ___
 * -  / _ \ | '_ \ / _` | '__/ _ \| |/ _` | \___ \| __| | | |/ _` | |/ _ \
 * - / ___ \| | | | (_| | | | (_) | | (_| |  ___) | |_| |_| | (_| | | (_) |
 * -/_/   \_\_| |_|\__,_|_|  \___/|_|\__,_| |____/ \__|\__,_|\__,_|_|\___/
 * <p>
 * You never know what you can do until you try !
 * ----------------------------------------------------------------
 * 描述：WebActivity
 */
class ConsealWebActivity : WebActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

    }

    //隐私政策摘要 type 0 隐私政策 1 隐私政策摘要 2 与第三方共享个人信息清单 3 应用权限说明 4 卡片商城规则 5 用户协议
    companion object {
        fun openUrl(context: Context, type: String) {
            //                var url = "https://www.suyiyong.cn/YSZZ/ywyszz.html?ifshownav=1"
            var url = ""
            when (type) {
                "0" -> {
                    if (BrandUtil.isBrandHuawei()) {
                        url = "https://www.suyiyong.cn/YSZZ/ywyszz_hw.html?ifshownav=1"
                    } else {
                        url = "https://www.suyiyong.cn/YSZZ/ywyszz.html?ifshownav=1"
                    }
                }

                "1" -> url = "https://www.suyiyong.cn/newYSZC/abstract.html?ifshownav=1"
                "2" -> url = "https://www.suyiyong.cn/newYSZC/SDK_explain.html?ifshownav=1"
                "3" -> url = "https://www.suyiyong.cn/newYSZC/power.html?ifshownav=1"
                "4" -> url = "https://www.suyiyong.cn/YSZZ/zhdqgzApp.html?ifshownav=1"
                "5" -> url = "https://www.suyiyong.cn/YSZZ/yhxyYWD.html?ifshownav=1"
            }
            if (url.isEmpty()) {
                return
            }
            context.startActivity(Intent(context, ConsealWebActivity::class.java).also {
                it.putExtra("url", url)
            })
        }
    }
}